/**
 * @Title: ParmsModel.java
 * @Description: 用一句话描述该文件做什么
 * @author zhangxin
 * @date 2019年3月27日
 */
package com.fortune.rainshinecommon.model.service;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fortune.rainshinecommon.base.BaseModel;

/**
 * @ClassName: ParmsModel
 * @Description: 消息实体
 * @author zhangxin
 * @date 2019年3月27日
 */
@TableName("sys_message")
public class MessageModel extends BaseModel {

	private static final long serialVersionUID = -8302411289879506663L;
	
	private Integer userId;//用户id
	private Integer states;//状态（0：未读；1:已读）
	private Integer type;//消息种类(1:所有消息;2:订单消息；3：预警信息)
	private String message;//消息主题
	private String title;//标题
	@TableField(exist = false)
	private String time;//格式化时间
	
	
	
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Integer getStates() {
		return states;
	}
	public void setStates(Integer states) {
		this.states = states;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public MessageModel() {
		super();
	}
	
	public MessageModel(Integer userId, Integer type,String shopName) {
		super();
		this.userId = userId;
		this.type = type;
		if(type == 1) {//采购订单
			this.title = "采购消息";
			this.message = "您收到一份采购订单,来自--"+shopName+",请及时处理！";
		}
		if(type == 2) {//确认出货
			this.title = "入库消息";
			this.message = "您的采购订单，采购方--"+shopName+"已确认出货,请及时查收！";
		}
		if(type == 3) {//预警消息
			this.title = "预警消息";
			this.message = "您的库存产品--"+shopName+"已达到预警上限，请及时采购！";
		}
		
	}
}
